package com.spzx.report.controller;

import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.report.service.SpzxReportService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;


/**
 * Package: com.spzx.report.controller
 *
 * @author xiongkunYang
 * @description:
 * @since 2025/6/11 9:11
 */
@RestController
@RequestMapping("/report")
public class SpzxReportController extends BaseController {

    private final SpzxReportService spzxReportService;

    public SpzxReportController(SpzxReportService spzxReportService) {
        this.spzxReportService = spzxReportService;
    }

    @GetMapping("analyzeQuestion/{question}")
    public AjaxResult analyzeQuestion(@PathVariable String question) {
        Map<String, String> questionMap = spzxReportService.analyzeQuestion(question);
        return success(questionMap);
    }

    @GetMapping("generateReport/{cacheKey}")
    public AjaxResult generateReport(@PathVariable String cacheKey) {
        Map<String, Object> xyMap = spzxReportService.generateReport(cacheKey);
        return success(xyMap);
    }



}